<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="/static/admin/images/favicon.ico" rel="icon">
    <link rel="stylesheet" href="/static/admin/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/admin/module/admin.css?v=318"/>
    {block name="head"}{/block}
</head>
<body>
{block name="main"}{/block}
<!-- js部分 -->
<script type="text/javascript" src="/static/admin/libs/layui/layui.js"></script>
<script type="text/javascript" src="/static/admin/js/common.js"></script>
<script src="https://lib.baomitu.com/jquery/3.5.0/jquery.min.js"></script>
<script>
    function del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: "{:adminurl('delete')}",
                data: {id: id},
                dataType: 'json',
                success: function (data) {
                    var result = data;
                    if (result.err == 0) { //删除成功
                        layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(result.msg, {icon: 2, time: 1000}, function () {
                            location.reload();
                        });
                    }
                },
                error: function (data) {
                    layer.msg(data);
                },
            });
        });
    }
</script>
{block name="js"}{/block}
</body>
</html>